
class TagInfo {

  static const String NAME = 'tag';
  static const String CREATE = 'CREATE TABLE IF NOT EXISTS $NAME(id INTEGER PRIMARY KEY AUTOINCREMENT, createTime Long, color INTEGER, tag TEXT UNIQUE, refCount INTEGER)';

  int id;
  int createTime;
  int color;
  String tag;
  int refCount;//引用次数

  TagInfo({
    this.id,
    this.createTime,
    this.color,
    this.tag,
    this.refCount,
  });

  TagInfo.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    createTime = json['createTime'];
    color = json['color'];
    tag = json['tag'];
    refCount = json['regCount'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data['id'] = id;
    data['createTime'] = createTime;
    data['color'] = color;
    data['tag'] = tag;
    data['refCount'] = refCount;
    return data;
  }

}